// AHAH functions (originally by Phil Ballard)                                                           

function callAHAH(url, pageElement, callMessage, errorMessage) {
     if(callMessage!='nopreload') {
       document.getElementById('loadingImage').innerHTML = callMessage;
     }
     try {
     req = new XMLHttpRequest();
     } catch(e) {
	req = false;
     }
     req.onreadystatechange = function() {responseAHAH(pageElement, errorMessage);};
     req.open("GET",url,true);
     req.send(null);
  }

function responseAHAH(pageElement, errorMessage) {
   var output = '';
   if(req.readyState == 4) {
      document.getElementById('loadingImage').innerHTML = '<img src=\"images/alpha.gif\" width=\"64\" height=\"10\" border=\"0\" vspace=\"1\" />';   
      if(req.status == 200) {
         output = req.responseText;
         document.getElementById(pageElement).innerHTML = output;
      } else {
         document.getElementById(pageElement).innerHTML += errorMessage+"\n"+output;
         }
      }
  }
  